icontheme: Add support for high resolution icons
authorCarlos Garnacho <carlos@lanedo.com>
Fri, 10 May 2013 16:06:00 +0000 (18:06 +0200)
committerAlexander Larsson <alexl@redhat.com>
Wed, 3 Jul 2013 12:39:26 +0000 (14:39 +0200)
commit58adb70d43dfc6a10dde5847850c8a58e0c08137
treef3b640ee0eb3cc4cadfd152409749a74964fab4c
parent07519abcde4e1b5fcb82c18c64716cca7b0920fb
icontheme: Add support for high resolution icons

An optional OutputScale integer key has been added to index.theme
subdirs description, so icon themes may provide icons that are
more suitable to render at a (typically 2x) integer upscaled
resolution. This way it is possible to make eg. a 16x16@2x icon has a
real size of 32x32, but contains a similar level of detail to the
16x16 icon so things don't look any more cluttered on high-dpi
screens.

The pixbuf lookup has changed so it prefers a minimal scale change
that yields the minimal real size difference, so if looking up for
a 16x16 icon at 2x, it would first prefer 16x16@2x, then 32x32, and
then any other icon that's closest to match

There is now *_for_scale() variants for all GtkIconTheme ways
to directly or indirectly fetch a GdkPixbuf.

This is based on code by Carlos Garnacho with changes by Alexander
Larsson
gtk/gtkicontheme.c
gtk/gtkicontheme.h